import time

import selenium
from selenium.webdriver import chrome
from selenium.webdriver.common.by import By


ur="file:///C:/Users/Administrator/Documents/Tencent%20Files/964244750/FileRecv/1.html"
dr=selenium.webdriver.Chrome()
dr.get(url=ur)#使用GET请求
dr.maximize_window()#浏览器最大化窗口
dr.find_element(By.XPATH,"/html/body/div/input[1]").click()#点击确认弹窗
qd=dr.switch_to.alert
time.sleep(2)
qd.accept()#点击确定

dr.find_element(By.XPATH,"/html/body/div/input[2]").click()#点击提示弹窗
time.sleep(2)
qd.accept()#点击确定


dr.find_element(By.XPATH,'/html/body/div/input[1]').click()#点击输入文本的弹窗
time.sleep(2)
qd.send_keys("2")#输入数字2
qd.accept()#点击确定

time.sleep(5)
dr.quit()#关闭



